class Solution {
public:
    string replaceSpace(string s) {
        string rst;
        for(char item : s){
            if(item == ' '){
                rst += "%20";
            } else {
                rst += item;
            }
        }
        return rst;
    }
};